package org.serverct.finalfight.util;

import java.io.Serializable;

public class StringPair implements Serializable {
    private final String key;
    private final String value;

    public String getKey() {
        return this.key;
    }

    public String getValue() {
        return this.value;
    }

    public StringPair(String key, Object value) {
        this.key = key;
        this.value = String.valueOf(value);
    }

    public String toString() {
        return this.key + "=" + this.value;
    }

    public int hashCode() {
        return this.key.hashCode() * 13 + (this.value == null ? 0 : this.value.hashCode());
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (!(o instanceof StringPair)) {
            return false;
        } else {
            StringPair pair = (StringPair) o;
            if (this.key != null) {
                if (!this.key.equals(pair.key)) {
                    return false;
                }
            } else if (pair.key != null) {
                return false;
            }

            if (this.value != null) {
                return this.value.equals(pair.value);
            } else {
                return pair.value == null;
            }
        }
    }
}

